1
2
3
4 package joeq.Scheduler;
5
6 import joeq.Runtime.Unsafe;
7 import jwutil.util.Assert;
8
9
10
11
12
13 public class jq_SynchThreadQueue extends jq_ThreadQueue {
14
15
16 public void enqueue(jq_Thread t) {
17 Assert._assert(Unsafe.getThreadBlock().isScheduler);
18 synchronized (this) {
19 super.enqueue(t);
20 }
21 }
22 public synchronized void enqueueFront(jq_Thread t) {
23 Assert._assert(Unsafe.getThreadBlock().isScheduler);
24 synchronized (this) {
25 super.enqueueFront(t);
26 }
27 }
28 public synchronized jq_Thread dequeue() {
29 Assert._assert(Unsafe.getThreadBlock().isScheduler);
30 synchronized (this) {
31 return super.dequeue();
32 }
33 }
34 public synchronized boolean remove(jq_Thread t2) {
35 Assert._assert(Unsafe.getThreadBlock().isScheduler);
36 synchronized (this) {
37 return super.remove(t2);
38 }
39 }
40
41 }